/**
 * 
 */
package org.insia.smartposse.xfire.service;

import java.util.List;

import org.insia.smartposse.config.DAOFactory;
import org.insia.smartposse.metier.Category;
import org.insia.smartposse.metier.CategoryTheme;
import org.insia.smartposse.metier.Project;
import org.insia.smartposse.metier.webservice.LightCategory;
import org.insia.smartposse.metier.webservice.LightCategoryTheme;
import org.insia.smartposse.metier.webservice.LightProject;
import org.insia.smartposse.metier.webservice.LightProjectSkill;
import org.insia.smartposse.metier.webservice.LightProjectSkillAffectation;
import org.insia.smartposse.xfire.iservice.IProjectService;

/**
 * @author raguerri
 * @since 18 avr. 07
 * @version 0.0.1
 * 
 */
public class ProjectService implements IProjectService {

	/* (non-Javadoc)
	 * @see org.insia.smartposse.xfire.iservice.IProjectService#get(long)
	 */
	public LightProject get(long id) {
		LightProject lproj = null;
		try {
			Project proj = DAOFactory.getProjectDAO().get(id);
			lproj = proj.setLight();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return lproj;
	}

	/* (non-Javadoc)
	 * @see org.insia.smartposse.xfire.iservice.IProjectService#getCategory(long)
	 */
	public LightCategory getCategory(long id) {
		LightCategory lcate = null;
		try {
			Category cate = DAOFactory.getCategoryDAO().get(id);
			lcate = cate.setLight();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return lcate;
	}

	/* (non-Javadoc)
	 * @see org.insia.smartposse.xfire.iservice.IProjectService#getCategoryTheme(long)
	 */
	public LightCategoryTheme getCategoryTheme(long id) {
		LightCategoryTheme lcatet = null;
		try {
			CategoryTheme catet = DAOFactory.getCategoryThemeDAO().get(id);
			lcatet = catet.setLight();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return lcatet;
	}

	/* (non-Javadoc)
	 * @see org.insia.smartposse.xfire.iservice.IProjectService#createLighProjectSkillAffectation(org.insia.smartposse.metier.webservice.LightProjectSkillAffectation)
	 */
	public LightProjectSkillAffectation createLighProjectSkillAffectation(LightProjectSkillAffectation projectSkillAffectation) {
		return DAOFactory.getProjectSkillAffectationDAO().createLighProjectSkillAffectation(projectSkillAffectation);
	}

	/* (non-Javadoc)
	 * @see org.insia.smartposse.xfire.iservice.IProjectService#createLightProject(org.insia.smartposse.metier.webservice.LightProject)
	 */
	public LightProject createLightProject(LightProject lproject) {
		return DAOFactory.getProjectDAO().createLightProject(lproject);
	}

	/* (non-Javadoc)
	 * @see org.insia.smartposse.xfire.iservice.IProjectService#createLightProject(java.util.List)
	 */
	public List<LightProject> createLightProject(List<LightProject> projectSet) {
		return DAOFactory.getProjectDAO().createLightProject(projectSet);
	}

	/* (non-Javadoc)
	 * @see org.insia.smartposse.xfire.iservice.IProjectService#createLightProjectSkill(org.insia.smartposse.metier.webservice.LightProjectSkill)
	 */
	public LightProjectSkill createLightProjectSkill(LightProjectSkill projectSkill) {
		return DAOFactory.getProjectSkillDAO().createLightProjectSkill(projectSkill);
	}

	/* (non-Javadoc)
	 * @see org.insia.smartposse.xfire.iservice.IProjectService#createLightProjectSkill(java.util.List)
	 */
	public List<LightProjectSkill> createLightProjectSkill(List<LightProjectSkill> projectSkills) {
		return DAOFactory.getProjectSkillDAO().createLightProjectSkill(projectSkills);
	}

	/* (non-Javadoc)
	 * @see org.insia.smartposse.xfire.iservice.IProjectService#updateLighProjectSkillAffectation(org.insia.smartposse.metier.webservice.LightProjectSkillAffectation)
	 */
	public LightProjectSkillAffectation updateLighProjectSkillAffectation(LightProjectSkillAffectation projectSkillAffectation) {
		return DAOFactory.getProjectSkillAffectationDAO().updateLighProjectSkillAffectation(projectSkillAffectation);
	}

	/* (non-Javadoc)
	 * @see org.insia.smartposse.xfire.iservice.IProjectService#updateLightProject(org.insia.smartposse.metier.webservice.LightProject)
	 */
	public LightProject updateLightProject(LightProject lproject) {
		return DAOFactory.getProjectDAO().updateLightProject(lproject);
	}

	/* (non-Javadoc)
	 * @see org.insia.smartposse.xfire.iservice.IProjectService#updateLightProject(java.util.List)
	 */
	public List<LightProject> updateLightProject(List<LightProject> projectSet) {
		return DAOFactory.getProjectDAO().updateLightProject(projectSet);
	}

	/* (non-Javadoc)
	 * @see org.insia.smartposse.xfire.iservice.IProjectService#updateLightProjectSkill(org.insia.smartposse.metier.webservice.LightProjectSkill)
	 */
	public LightProjectSkill updateLightProjectSkill(LightProjectSkill projectSkill) {
		return DAOFactory.getProjectSkillDAO().updateLightProjectSkill(projectSkill);
	}

	/* (non-Javadoc)
	 * @see org.insia.smartposse.xfire.iservice.IProjectService#updateLightProjectSkill(java.util.List)
	 */
	public List<LightProjectSkill> updateLightProjectSkill(List<LightProjectSkill> projectSkills) {
		return DAOFactory.getProjectSkillDAO().updateLightProjectSkill(projectSkills);
	}

}
